﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="NamedValue.cs" company="">
//   
// </copyright>
// <summary>
//   The named value.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Libium
{
    /// <summary>
    /// The named value.
    /// </summary>
    /// <typeparam name="T">
    /// </typeparam>
    public class NamedValue<T> : INamedValue<T>, INamedValue
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="NamedValue{T}"/> class.
        /// </summary>
        /// <param name="name">
        /// The name. 
        /// </param>
        /// <param name="value">
        /// The value. 
        /// </param>
        public NamedValue(string name, T value)
        {
            this.Name = name;
            this.Value = value;
        }

        #endregion

        #region Public Properties

        /// <summary>
        ///   Gets the name.
        /// </summary>
        public string Name { get; private set; }

        /// <summary>
        ///   Gets the value.
        /// </summary>
        public T Value { get; private set; }

        #endregion

        #region Explicit Interface Properties

        /// <summary>
        ///   Gets the name.
        /// </summary>
        string INamedValue.Name
        {
            get
            {
                return this.Name;
            }
        }

        /// <summary>
        ///   Gets the value.
        /// </summary>
        object INamedValue.Value
        {
            get
            {
                return this.Value;
            }
        }

        #endregion
    }
}